package com.example.mapper;


import com.example.pojo.Disciple;
import org.apache.ibatis.annotations.*;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.util.List;

/**
 * 员工管理
 */
@Mapper
@Transactional
public interface DiscipleMapper {


//    @Select("select *from disciple")
    List<Disciple> list(String name, Short gender, LocalDate begin, LocalDate end,Boolean ise);
    List<Disciple> list2(String name, Short job, Short deptId,LocalDate begin, LocalDate end,Boolean ise);

    @Select("select *from disciple")
    List<Disciple> getlist();
    //@Delete("delete from disciple where id=1")
    void delete(List<Integer> ids);

    @Insert("INSERT INTO disciple(name, image, gender, job, entrydate, dept_id,create_time,update_time) " +
            "VALUES (#{name}, #{image}, #{gender}, #{job},#{entrydate},#{deptId} ,#{createTime}, #{updateTime})")
    void insert(Disciple disciple);
    @Select("select *from disciple where id=#{id}")
    Disciple getById(Integer id);

   // @Update("update disciple set gender=#{gender} where name=#{name}")
    void update(Disciple disciple);
    @Select("select *from position")
    List<Disciple> getJoblist();
    @Select("select * from disciple where password=#{password} and username=#{username}")
    Disciple login(Disciple disciple);

}
